import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';
import Mock from 'mockjs'

// 交车预约登记详情--PC
export const qryDeliveryDetailBySoVinId = params => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/salesOrders/qryDeliveryDetailBySoVinId`, { params } )
// 交车管理分页查询--PC
export const qryDeliveryManagePage = params => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/salesOrders/qryDeliveryManagePage`, { params } )
// 销售订单选择(交车)--PC
export const qryDeliverySelectPage = params => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/salesOrders/qryDeliverySelectPage`, { params } )
// 交车预约登记
export const deliveryRegister = params => axios.post(`${SERVER.CYXDMS_RETAIL}/ordermanage/salesOrders/deliveryRegister`, params )
// 时间看板
export const qryDeliveryBoard = params => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/salesOrders/qryDeliveryBoard`, { params } )

// 交车管理分页查询--Mock
export const mockDataList = params => Mock.mock({
  'data': {
    'current': params.currentPage,
    'pages': params.pageNum,
    'size': params.pageSize,
    'total': 36,
    'records|1-10': [{
      'id|+1': 1,
      'viNo': /^SN[\d]{10}$/, // 销售订单号
      'customerName': '@cname',// 客户名称
      'mobilePhone': /^[1]([3-9])[0-9]{9}$/, // 手机
      'consultant': '@cname', // 所属销售顾问
      'carType': Mock.Random.pick([19011001,19011002,19011003]), // 订单车辆类别
      // 'carType': 19011001, // 订单车辆类别
      // 'changeCarPlace': '交车间4', // 交车地点
      'changeCarPlace': Mock.Random.pick(['交车间1','交车间2','交车间3','交车间4']), // 交车地点
      'vin': /^PN[\d]{10}$/, // 销售订单号
      'seriesName': '', // 车系
      'modelName': '', // 车型
      'packageName': '', // 配置
      'colorName': '', // 颜色
      'deliveringDateStart': Mock.Random.datetime(), // 预计交车开始时间
      'deliveringDateEnd': Mock.Random.datetime(), // 预计交车开始时间
    }]
  },
  'elapsedMilliseconds': 0,
  'errMsg': null,
  'resultCode': 200,
  'success': true,
})
